// 视图组件
const view = {
  tabs: () => import("@/layouts/tabs"),
  blank: () => import("@/layouts/BlankView"),
  page: () => import("@/layouts/PageView"),
  user: () => import("@/layouts/UserLayout")
};
const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

/**
 * 路由配置
 * name	菜单名称
 * path	点击菜单时的跳转链接
 * meta.icon	菜单图标，图标使用 ant-design-vue 图标库，对应 Icon 组件 的 type 属性
 * meta.invisible	是否不将此路由项渲染为菜单项，默认false；如设置为 true，则生成菜单时将忽略此路由
 * meta.page.closable 页面是否可关闭，默认为true
 * meta.page.cacheAble 页面是否可缓存，默认为true
 *
 */
const options = {
  routes: [
    {
      path: "/login",
      name: "登录",
      component: () => import("@/pages/login")
    },
    {
      path: "/auth",
      name: "用户授权",
      component: () =>
          import(/* webpackChunkName: "result" */ "@/pages/login/Auth"),
      meta: {
        invisible: true
      }
    },
    {
      path: "*",
      name: "404",
      component: () => import("@/pages/exception/404")
    },
    {
      path: "/403",
      name: "403",
      component: () => import("@/pages/exception/403")
    },
    {
      path: "/",
      name: "首页",
      component: view.tabs,
      // redirect: "/login",
      children: [
        {
          path: "/workplace",
          name: "workplace",
          meta: {
            title: 'menu.workplace',
            icon: "dashboard",
            page: {
              closable: false
            }
          },
          component: () => import("@/pages/dashboard/workplace/WorkPlace"),

        },
        {
          path: '/deviceManagement',
          name: 'deviceManagement',
          component: view.blank,
          meta: { title: 'menu.deviceManagement', icon: 'table', permission: ['form'] },
          children: [
            // 台账
            {
              path: '/deviceManagement/ledger',
              name: 'ledger',
              icon: "schedule",
              component: () => import('@/pages/deviceManagement/ledger'),
              meta: { title: 'menu.deviceManagement.ledger', keepAlive: true, permission: ['form'] }
            },
            // 设备组
            {
              path: '/deviceManagement/deviceGroup',
              name: 'deviceGroup',
              icon: "schedule",
              component: () => import('@/pages/deviceManagement/deviceGroup'),
              meta: { title: 'menu.deviceManagement.deviceGroup', keepAlive: true, permission: ['form'] }
            },
            // 备品备件
            {
              path: '/deviceManagement/sparePartsModule',
              name: 'sparePartsModule',
              component: () => view.blank(),
              meta: { title: 'menu.deviceManagement.sparePartsModule', icon:'schedule', keepAlive: true, permission: ['form'] },
              children: [
                {
                  path: '/deviceManagement/sparePartsModule/spareParts',
                  name: 'spareParts',
                  component: () => import('@/pages/deviceManagement/spareParts'),
                  meta: { title: 'menu.deviceManagement.sparePartsModule.spareParts', keepAlive: true, permission: ['form'] }
                },
                {
                  path: '/deviceManagement/sparePartsModule/sparePartsRequest',
                  name: 'sparePartsRequest',
                  component: () => import('@/pages/deviceManagement/sparePartsRequest'),
                  meta: { title: 'menu.deviceManagement.sparePartsModule.sparePartsRequest', keepAlive: true, permission: ['form'] }
                },
                {
                  path: '/deviceManagement/sparePartsModule/sparePartsWarehousing',
                  name: 'sparePartsWarehousing',
                  component: () => import('@/pages/deviceManagement/sparePartsWarehousing'),
                  meta: { title: 'menu.deviceManagement.sparePartsModule.sparePartsWarehousing', keepAlive: true, permission: ['form'] }
                },
                {
                  path: '/deviceManagement/sparePartsModule/sparePartsUsed',
                  name: 'sparePartsUsed',
                  component: () => import('@/pages/deviceManagement/sparePartsUsed'),
                  meta: { title: 'menu.deviceManagement.sparePartsModule.sparePartsUsed', keepAlive: true, permission: ['form'] }
                }

              ]
            }
          ]
        },
        {
          path: '/deviceMaintenance',
          name: 'deviceMaintenance',
          component: view.blank,
          meta: { title: 'menu.deviceMaintenance', icon: 'table', permission: ['form'] },
          children: [
            {
              path: '/deviceMaintenance/maintenancePlan',
              name: 'maintenancePlan',
              invisible: true,
              component: () => import('@/pages/deviceMaintenance/maintenancePlan.vue'),
              meta: { title: 'menu.deviceMaintenance.maintenancePlan', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/deviceMaintenance/maintenanceTask',
              name: 'maintenanceTask',
              component: () => import('@/pages/deviceMaintenance/maintenanceTask.vue'),
              meta: { title: 'menu.deviceMaintenance.maintenanceTask', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/deviceMaintenance/maintenance',
              name: 'maintenance',
              component: () => import('@/pages/deviceMaintenance/maintenance.vue'),
              meta: { title: 'menu.deviceMaintenance.maintenance', keepAlive: true, permission: ['form'] }
            }
          ]
        },
        {
          path: '/deviceRepair',
          name: 'deviceRepair',
          component: view.blank,
          meta: { title: 'menu.deviceRepair', icon: 'table', permission: ['form'] },
          children:[
            {
              path: '/deviceRepair/repairOrder',
              name: 'repairOrder',
              component: () => import('@/pages/deviceRepair/repairOrder'),
              meta: { title: 'menu.deviceRepair.repairOrder', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/deviceRepair/repair',
              name: 'repair',
              component: () => import('@/pages/deviceRepair/repair'),
              meta: { title: 'menu.deviceRepair.repair', keepAlive: true, permission: ['form'] }
            }
          ]
        },
        {
          path: '/deviceSpotCheck',
          name: 'deviceSpotCheck',
          component: view.blank,
          meta: { title: 'menu.deviceSpotCheck', icon: 'table', permission: ['form'] },
          children:[
            {
              path: '/deviceSpotCheck/spotCheckPlan',
              name: 'spotCheckPlan',
              component: () => import('@/pages/deviceSpotCheck/spotCheckPlan'),
              meta: { title: 'menu.deviceSpotCheck.spotCheckPlan', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/deviceSpotCheck/spotCheck',
              name: 'spotCheck',
              component: () => import('@/pages/deviceSpotCheck/spotCheck'),
              meta: { title: 'menu.deviceSpotCheck.spotCheck', keepAlive: true, permission: ['form'] }
            }
          ]
        },
        {
          path: '/reportQuery',
          name: 'reportQuery',
          component: view.blank,
          meta: { title: 'menu.reportQuery', icon: 'table', permission: ['form'] },
          children:[
            {
              path: '/reportQuery/maintenanceAnalysis',
              name: 'maintenanceAnalysis',
              component: () => import('@/pages/reportQuery/maintenanceAnalysis'),
              meta: { title: 'menu.reportQuery.maintenanceAnalysis', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/reportQuery/maintenanceCompletion',
              name: 'maintenanceCompletion',
              component: () => import('@/pages/reportQuery/maintenanceCompletion'),
              meta: { title: 'menu.reportQuery.maintenanceCompletion', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/reportQuery/spotCheckAnalysis',
              name: 'spotCheckAnalysis',
              component: () => import('@/pages/reportQuery/spotCheckAnalysis'),
              meta: { title: 'menu.reportQuery.spotCheckAnalysis', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/reportQuery/spotCheckCompletion',
              name: 'spotCheckCompletion',
              component: () => import('@/pages/reportQuery/spotCheckCompletion'),
              meta: { title: 'menu.reportQuery.spotCheckCompletion', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/reportQuery/deviceRepairCompletion',
              name: 'deviceRepairCompletion',
              component: () => import('@/pages/reportQuery/deviceRepairCompletion'),
              meta: { title: 'menu.reportQuery.deviceRepairCompletion', keepAlive: true, permission: ['form'] }
            }
          ]
        },
        {
          path: '/basicInfo',
          name: 'basicInfo',
          component: view.blank,
          meta: { title: 'menu.basicInfo', icon: 'table', permission: ['form'] },
          children:[
            {
              path: '/basicInfo/deviceCategory',
              name: 'deviceCategory',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/deviceCategory'),
              meta: { title: 'menu.basicInfo.deviceCategory', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/basicInfo/deviceGrade',
              name: 'deviceGrade',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/deviceGrade'),
              meta: { title: 'menu.basicInfo.deviceGrade', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/basicInfo/sparePartsCategory',
              name: 'sparePartsCategory',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/sparePartsCategory'),
              meta: { title: 'menu.basicInfo.sparePartsCategory', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/basicInfo/maintenanceCategory',
              name: 'maintenanceCategory',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/maintenanceCategory'),
              meta: { title: 'menu.basicInfo.maintenanceCategory', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/basicInfo/maintenanceProject',
              name: 'maintenanceProject',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/maintenanceProject'),
              meta: { title: 'menu.basicInfo.maintenanceProject', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/basicInfo/failureCause',
              name: 'failureCause',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/failureCause'),
              meta: { title: 'menu.basicInfo.failureCause', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/basicInfo/spotCheckProject',
              name: 'spotCheckProject',
              icon: "schedule",
              component: () => import('@/pages/basicInfo/spotCheckProject'),
              meta: { title: 'menu.basicInfo.spotCheckProject', keepAlive: true, permission: ['form'] }
            }
          ]
        },
        {
          path: '/systemManagement',
          name: 'systemManagement',
          component: view.blank,
          meta: { title: 'menu.systemManagement', icon: 'table', permission: ['form'] },
          children: [
            {
              path: '/systemManagement/systemSetting',
              name: 'systemSetting',
              icon: "schedule",
              component: () => import('@/pages/systemManagement/systemSetting'),
              meta: { title: 'menu.systemManagement.systemSetting', keepAlive: true, permission: ['form'] }
            },
            {
              path: '/systemManagement/authorityManagement',
              name: 'authorityManagement',
              icon: "schedule",
              invisible: false,
              component: () => import('@/pages/systemManagement/authorityManagement'),
              meta: { title: 'menu.systemManagement.authorityManagement', keepAlive: true, permission: ['form'] }
            }
          ]
        }
        // {
        //   path: "group",
        //   name: "权限管理组",
        //   redirect: "group/index",
        //   meta: {
        //     icon: "schedule"
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       path: "index",
        //       meta: {
        //         invisible: true
        //       },
        //       name: "管理组列表",
        //       component: () => import("@/pages/权限管理组/CardList")
        //     },
        //     {
        //       path: "edit/:id",
        //       meta: {
        //         invisible: true
        //       },
        //       name: "编辑管理组",
        //       component: () => import("@/pages/权限管理组/BasicForm")
        //     },
        //     {
        //       path: "add",
        //       meta: {
        //         invisible: true
        //       },
        //       name: "新增管理组",
        //       component: () => import("@/pages/权限管理组/BasicForm")
        //     },
        //     {
        //       path: "detail/:id",
        //       meta: {
        //         invisible: true
        //       },
        //       name: "管理组详情",
        //       component: () => import("@/pages/权限管理组/BasicDetail")
        //     },
        //   ]
        // },
        // {
        //   path: "User",
        //   name: "用户管理",
        //   redirect: "User/index",
        //   meta: {
        //     icon: "team"
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       meta: {
        //         invisible: true
        //       },
        //       path: "index",
        //       name: "列表",
        //       component: () => import("@/pages/用户管理/QueryList")
        //     },
        //     {
        //       meta: {
        //         invisible: true
        //       },
        //       path: "edit/:id",
        //       name: "用户信息编辑",
        //       component: () => import("@/pages/用户管理/BasicForm")
        //     },
        //     {
        //       meta: {
        //         invisible: true
        //       },
        //       path: "add",
        //       name: "新增用户",
        //       component: () => import("@/pages/用户管理/BasicForm")
        //     },
        //     {
        //       meta: {
        //         invisible: true
        //       },
        //       path: "detail/:id",
        //       name: "查看用户信息",
        //       component: () => import("@/pages/用户管理/BasicDetail")
        //     }
        //   ]
        // },
        // {
        //   path: "Organization",
        //   name: "组织机构树管理",
        //   redirect: "Organization/index",
        //   meta: {
        //     icon: "table"
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       meta: {
        //         invisible: true
        //       },
        //       path: "index",
        //       name: "树形列表",
        //       component: () => import("@/pages/组织机构树管理/QueryList")
        //     }
        //   ]
        // },
        // {
        //   name: "个人中心",
        //   path: "personalCenter",
        //   meta: {
        //     invisible: true
        //   },
        //   component: () => import("@/pages/个人中心/index")
        // },
      ]
    }
  ]
};

export default options;
